<%@ page import="entity.Emp" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2024/5/13
  Time: 11:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>员工列表</title>
    </head>
    <body>
        <h1>员工列表</h1>
        <table>
            <thead>
                <td>编号</td>
                <td>姓名</td>
                <td>工资</td>
                <td>操作</td>
            </thead>
            <tbody>

                <%
                  List<Emp> emps= (List<Emp>) request.getAttribute("emps");
                  for(Emp emp:emps){
                %>
                <tr>
                    <td><%=emp.getId()%></td>
                    <td><%=emp.getName()%></td>
                    <td><%=emp.getSalary()%></td>
                    <td>
                        <a href="<%=request.getContextPath()%>/findById.ems?id=<%=emp.getId()%>">修改</a>
                        <a href="<%=request.getContextPath()%>/delete.ems?id=<%=emp.getId()%>">删除</a>
                    </td>
                </tr>
                <%
                    }
                %>

            </tbody>
        </table>
    </body>
</html>
